<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo input('ks');?> - {:config('web.WEB_AUT')}</title>
<meta name="keywords" content="{:config('web.WEB_KEY')}">
<meta name="description" content="{:config('web.WEB_DES')}">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> 
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
{include file="index/header"}
<script type="text/javascript">
$(function (){
  var listWidth = $(".list-main li").innerWidth();//取商品列表图片宽
  $(".list-main li img").css('height',listWidth);
})
</script>
<div class="filter">
  <div id="subnav" class="subnav" style="display: block;">
    <div class="subnav-main">
      <ul>
        <li><a href="/">全部</a></li>
        {volist name="CategoryList" id="vo"}
        <li><a href="{:url('cat/'.$vo.id)}" {if condition="$cid eq $vo['id']"}class="active"{/if}>{$vo.name}</a></li>
        {/volist}
      </ul>
    </div>
    <div class="drop-down">
      <a href="javascript:;" onclick="sidenavIn()" class="btn-left"><i class="layui-icon">&#xe61a;</i></a>
    </div> 
  </div>
</div>
<div class="goods-list" style="margin:0 0 60px 0;">
  <div class="layui-main">
    <fieldset><legend><a name="use">搜索结果</a></legend></fieldset>
  </div>
  <ul class="list-main" id="LAY_list">
    <!--产品列表start-->
    {include file="public/goods"}
    <!--产品列表end-->
    <!--产品列表-start-ajax请求产品数据并push到页面-->
    <!--<script src="__MOBILE__/mods/findGoodsList.js" charset="utf-8"></script>-->
    <!--产品列表-end-ajax请求产品数据并push到页面-->
    <script type="text/javascript">
        var listWidth = $(".list-main li").innerWidth();
        layui.use('flow', function(){
            var $ = layui.jquery;
            var flow = layui.flow;
            flow.load({
                elem: '#LAY_list'
                ,isLazyimg:true
                ,done: function(page, next){
                    var lis = [];
                    $.post("{:url('AjaxRequest/findGoodsList')}?ks={$ks}&page="+(page+1), function(res){
                        if(res.code==1){
                            layui.each(res.data.data, function(index, item){
                                lis.push('<li><div class="goods-main"><div class="pic"><a href="'+item.url+'"><img class="lazy" src="__MOBILE__/img/goods-loading.gif" data-original="'+item.pic+'" alt="'+item.title+'" style="height:'+listWidth+'px"></a></div>'+item.couponAmount+'<h3 class="title"><span class="label">包邮</span>'+item.title+'</h3><div class="original-info"><p>店铺:<em>'+item.nick+'</em></p><p class="rebate-money">返利金额<em>¥</em> '+item.commissionUser+'</p></div><div class="original-price"><span class="price">现价<em>￥</em>'+item.couponPrice+'</span><span class="sold">月销<em>'+item.volume+'</em></span></div><div class="coupon-rate"><span class="price"><em>￥</em>'+item.couponRate+'</span><i class="quan-price"></i><div class="btn-buy"><em class="'+item.icon+'"></em></div></div></div></li>');
                            });
                            next(lis.join(''), page < res.data.pages);
                            $("img.lazy").lazyload({effect: "fadeIn"});
                        }else{
                            console.log(res.msg);
                        }
                    });
                }
            });
        });
    </script>
  </ul>
</div>
{include file="index/footer"}
</body>
</html>

